import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import dayjs from 'dayjs'

// 代码高亮
import '@/directive/highlight'

Vue.config.productionTip = false

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/scroll.css';
import './assets/css/index.css'
import 'element-ui/lib/theme-chalk/display.css';

import { Dialog, Toast } from 'vant'

import { IsPC } from '@/utils/isPC'
import { debounce } from '@/utils/tool'

Vue.prototype.$ispc = IsPC()

Vue.prototype.imageUrl = 'http://www.gcosc.fun:81/static'

import echarts from 'echarts'

Vue.prototype.$echarts = echarts 

Vue.use(ElementUI, {
    size : Vue.prototype.$ispc ? '' : 'mini'
});


sessionStorage.setItem('ispc', Vue.prototype.$ispc)

if (!Vue.prototype.$ispc) {
    Vue.prototype.$confirm = (message, title) => Dialog.confirm({title, message})
    Vue.prototype.$message = Toast
    Vue.prototype.$message.error = Toast.fail
}
Vue.prototype.$size = Vue.prototype.$ispc ? '' : 'mini'

// Vue.prototype.$message = debounce(Vue.prototype.$message, 500)

Vue.prototype.dayjs = dayjs

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
